import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from "./store"
import dayjs from 'dayjs'

import './plugins/element.js'
import './assets/css/global.css'

import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme
// import 'quill/dist/quill.bubble.css' // for bubble theme

import mocker from "./mock/mockServer";

import axios from 'axios'
// axios.defaults.baseURL='http://127.0.0.1:8888/api/private/v1/'
// axios.defaults.baseURL='https://lianghj.top:8888/api/private/v1/'
// axios.defaults.baseURL='/api/private/v1/'
axios.defaults.baseURL=process.env.VUE_APP_API;
axios.interceptors.request.use(config => {
  config.headers.Authorization=window.sessionStorage.getItem('token');
  return config;
});

Vue.prototype.$http=axios;
Vue.config.productionTip = false;
Vue.filter('dateFormat',oldVal=>{
  return dayjs.unix(oldVal).format('YYYY-MM-DD HH:mm');
});

Vue.use(VueQuillEditor);

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app');

